<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">

<head>

    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>用户商品销售月统计(某个用户的团队)</title>

    <link rel="stylesheet" href="http://cdn.viptool.cn/lib/bootstrap/3.3.5/css/bootstrap.min.css">
    <link href="../../resource/hotui/css/font-awesome.min.css" th:href="@{/resource/hotui/css/font-awesome.min.css}"
          rel="stylesheet">
    <!-- Morris -->
    <link href="http://cdn.viptool.cn/lib/morris.js/0.4.3/morris.css" rel="stylesheet">
    <link href="http://cdn.viptool.cn/lib/animate.css/2.1.1/animate.min.css" rel="stylesheet">
    <link href="../../resource/hotui/css/style.min-1.0.8.css" th:href="@{/resource/hotui/css/style.min-1.0.8.css}"
          rel="stylesheet">
    <link href="../../resource/hotui/css/hotui.style.override.css"
          th:href="@{/resource/hotui/css/hotui.style.override.css}" rel="stylesheet"/>
    <link href="http://cdn.viptool.cn/lib/switchery/0.8.2/switchery.min.css" rel="stylesheet"/>
    <link href="http://cdn.viptool.cn/lib/bootstrap-daterangepicker/2.1.25/daterangepicker.min.css" rel="stylesheet">
    <link href="../../resource/lib/imageview/css/imageviewer.css" rel="stylesheet"/>

    <style type="text/css">
        .hr-line-dashed {
            margin: 10px 0;
            height: 1px;
            border-top: 1px dashed #e7eaec;
            background-color: #fff;
            color: #fff;
        }

        .city-picker-selector select {

        }

        .daterangepicker {
            z-index: 999999999 !important;
        }
    </style>
</head>

<body class="gray-bg">
<div class="wrapper wrapper-content animated fadeInRight tooltip-demo">
    <!--search-->
    <form role="form" id="searchForm" class="search-panel" method="get" th:object="${condition}">
        <div class="row">
            <div class="col-lg-12">
                <div class="ibox">
                    <div class="ibox-title">
                        <span class="text-warning" style="font-size: 16px;"
                              th:text="|${parentUser.username}(${parentUser.realName})的【*{dimension==1?'安置':'推荐'}】团队|">13754325420(王明)的安置团队</span>

                        <a href="/stats/userGoodsSale/monthlyStats">
                            <button type="button"
                                    class="btn btn-info btn-sm m-b-none" style="float:right;">
                                返回上级
                            </button>
                        </a>
                    </div>
                    <div class="ibox-content">
                        <div class="form-inline">
                            <input type="hidden" th:value="*{pageIndex}" name="pageIndex"/>
                            <input type="hidden" th:value="*{parentUserId}" name="parentUserId"/>
                            <input type="hidden" th:value="*{dimension}" name="dimension"/>
                            <div class="form-group m-r-sm">
                                <label class=" control-label">盛塘期：</label>
                                <select class="form-control" name="monthTag" id="monthTag">
                                    <option value="0">==所有==</option>
                                    <option th:each="issueInfo:${issueList}"
                                            th:value="${issueInfo.issueNo}"
                                            th:text="|${issueInfo.name}(${issueInfo.beginDate}至${issueInfo.endDate})|"
                                            th:selected="${issueInfo.issueNo}==*{monthTag}">==所有==
                                    </option>
                                </select>
                            </div>

                            <div class="form-group m-r-sm">
                                <button type="button" onclick="userGoodsSaleList.search(1)"
                                        class="btn btn-primary btn-sm m-b-none searchBtn">筛选
                                </button>
                                <button type="button" onclick="userGoodsSaleList.searchAll()"
                                        class="btn btn-primary btn-sm m-b-none">显示全部
                                </button>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </form>
    <!--search-->

    <!--list-->
    <div class="row">
        <div class="col-lg-12">
            <div class="ibox float-e-margins m-b-none">
                <div class="tabs-container">
                    <div class="tab-content">
                        <div class="tab-pane active">
                            <div class="panel-body">
                                <table class="table table-bordered table-hover table-center">
                                    <thead>
                                    <tr>
                                        <th>序号</th>
                                        <th>会员</th>
                                        <th>盛塘期</th>
                                        <th>TA自己</th>
                                        <th th:if="${condition.dimension==0}">团队报单数(推荐)</th>
                                        <th th:if="${condition.dimension==0}">团队复销数(推荐)</th>
                                        <th th:if="${condition.dimension==1}">团队报单数(安置)</th>
                                        <th th:if="${condition.dimension==1}">团队复销数(安置)</th>
                                    </tr>
                                    </thead>
                                    <tbody>
                                    <!--/*@thymesVar id="row" type="com.shengtang.stagent.data.entity.SaleGoodsMonthlyStatsPO"*/-->
                                    <tr th:each="row,index:${list}">
                                        <td th:text="${index.count}">123123</td>
                                        <td style="text-align: left;padding-left: 30px;">
                                            <span th:text="|${row.user.realName}(${row.user.userLevelPO.levelName})|">王明(大区经理)</span>
                                            <br/>
                                            <span th:text="${row.user.username}">17678767675</span>
                                            <br/>
                                            <span th:text="${row.user.idcardNo}">33098988787676</span>
                                        </td>
                                        <td>第<span th:text="${row.monthTag}"></span>期</td>
                                        <td style="text-align: left;padding-left: 30px;">
                                            报单：<span th:text="${row.selfDebitNum}"></span>件(<span
                                                th:text="${row.selfDebitAmount}"></span>元)
                                            <br>
                                            复销：<span th:text="${row.selfRepeatNum}"></span>件(<span
                                                th:text="${row.selfRepeatAmount}"></span>元)
                                        </td>
                                        <td style="text-align: left;padding-left: 30px;" th:if="${condition.dimension==0}">
                                            <span th:text="${row.teamInviteDebitNum}"></span>件(<span
                                                th:text="${row.teamInviteDebitAmount}"></span>元)
                                        </td>
                                        <td style="text-align: left;padding-left: 30px;" th:if="${condition.dimension==0}">
                                            <span th:text="${row.teamInviteRepeatNum}"></span>件(<span
                                                th:text="${row.teamInviteRepeatAmount}"></span>元)
                                        </td>
                                        <td style="text-align: left;padding-left: 30px;" th:if="${condition.dimension==1}">
                                            <span th:text="${row.teamPositDebitNum}"></span>件(<span
                                                th:text="${row.teamPositDebitAmount}"></span>元)
                                        </td>
                                        <td style="text-align: left;padding-left: 30px;" th:if="${condition.dimension==1}">
                                            <span th:text="${row.teamPositRepeatNum}"></span>件(<span
                                                th:text="${row.teamPositRepeatAmount}"></span>元)
                                        </td>
                                    </tr>
                                    </tbody>
                                </table>
                                <p style="float: left; margin: 20px 0;">
                                    共<span th:text="${totalRecords}"></span>条记录，当前第<span th:text="${pageIndex}"></span>/<span
                                        th:text="${totalPages==0?1:totalPages}"></span>，每页20条记录
                                </p>
                                <ul style="float: right;" class="pagination pagination-split">
                                </ul>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>

<!--基础框架js-->
<script src="http://cdn.viptool.cn/lib/jquery/2.2.4/jquery.min.js"></script>
<script src="http://cdn.viptool.cn/lib/bootstrap/3.3.5/js/bootstrap.min.js"></script>
<script src="../../resource/hotui/js/hot/bootstrap.hot.extra-utils.js?20190316"
        th:src="@{/resource/hotui/js/hot/bootstrap.hot.extra-utils.js?20190316}"></script>
<script src="../../resource/hotui/js/hot/bootstrap.hot.extra-init.js?20190316"
        th:src="@{/resource/hotui/js/hot/bootstrap.hot.extra-init.js?20190316}"></script>
<script src="../../resource/hotui/js/content.min.js" th:src="@{/resource/hotui/js/content.min.js}"></script>

<script src="http://cdn.viptool.cn/lib/moment.js/2.19.2/moment.min.js"></script>
<script src="../../resource/hotui/js/plugins/datetimepick/js/daterangepicker.js"
        th:src="@{/resource/hotui/js/plugins/datetimepick/js/daterangepicker.js}"></script>
<script src="http://cdn.viptool.cn/lib/switchery/0.8.2/switchery.min.js"></script>

<script src="../../resource/lib/cityPicker/citydata.min.js"></script>
<script src="../../resource/lib/cityPicker/cityPicker-2.0.3.js"></script>

<script src="../../resource/lib/imageview/js/imageviewer.min.js"></script>

<script src="../../js/stagent.uri.constant.js"></script>

<script type="text/javascript" th:inline="javascript">
    const pageIndex = /*[[${pageIndex}]]*/  1;
    const totalPages = /*[[${totalPages}]]*/  0;
    const pageUri = /*[[@{/stats/userGoodsSale/monthlyStatsByLeader}]]*/  "";
</script>

<script src="https://cdn.bootcss.com/Mock.js/1.0.0/mock-min.js"></script>

<script>
    $(function () {
        //初始化分页
        var pageinate = new hot.paging(".pagination", pageIndex, totalPages, 7);

        pageinate.init(function (p) {
            userGoodsSaleList.search(p);
        });

        $(document).keyup(function (event) {
            if (event.keyCode == 13) {
                $(".searchBtn").trigger("click");
            }
        });
    });

    var userGoodsSaleList = {
        search: function (pageIndex) {
            $("input[name=pageIndex]").val(pageIndex);
            $("#searchForm").submit();
        },
        searchAll: function () {
            $('#monthTag').val(0);
            $("#searchForm").submit();
        }
    };
</script>
</body>
</html>
